#include <iostream>
using namespace std;

// 用到状态记录的思想，往前往后各1，只需考虑最近的4个，不用做重复计算

bool check(int a[], int head, int tail) {
    if (head == tail)
        return true;
    int bal = a[head];
    for (int i = head; i < tail - 1; i++) {
        bal = a[i + 1] - bal;
        if (bal < 0)
            return false;
    }
    return bal == 0;
}

bool check4(int x1, int x2, int x3, int x4) {
    int a[4] = {x1, x2, x3, x4};
    return check(a, 0, 4);
}

void swap(int a[], int i, int j) {
    int tmp = a[i];
    a[i] = a[j];
    a[j] = tmp;
}

bool solve() {
    int n;
    cin >> n;

    int a[n], head[n], tail[n];

    for (int i = 0; i < n; i++)
        cin >> a[i];

    if (check(a, 0, n))
        return true;

    swap(a, 0, 1);
    if (check(a, 0, n))
        return true;
    swap(a, 0, 1);

    swap(a, n - 2, n - 1);
    if (check(a, 0, n))
        return true;
    swap(a, n - 2, n - 1);

    head[0] = a[0];
    for (int i = 1; i < n; i++)
        head[i] = ((head[i - 1] > a[i]) || (head[i - 1] < 0))
                      ? -1
                      : a[i] - head[i - 1];

    tail[n - 1] = a[n - 1];
    for (int i = n - 2; i >= 0; i--)
        tail[i] = ((a[i] < tail[i + 1]) || (tail[i + 1] < 0))
                      ? -1
                      : a[i] - tail[i + 1];

    for (int i = 1; i < n - 2; i++) {
        if (head[i - 1] >= 0 && tail[i + 2] >= 0 &&
            check4(head[i - 1], a[i + 1], a[i], tail[i + 2]))
            return true;
    }

    return false;
}

int main() {
    int t;
    cin >> t;
    while (t-- > 0)
        cout << (solve() ? "YES" : "NO") << endl;
    return 0;
}